
--metatable的__ index域是table
local mt0 = { hello = "hello world" }
local mt1 = setmetatable({}, {__index = mt0})
mt1.key2 = "key2"
local tbl = setmetatable({}, {__index = mt1})
print(tbl.hello)
print(tbl.key)
print(tbl.key2)

--[[
    hello world
    nil
    key2
]]